package cn.lsc.exception;

import cn.lsc.enums.GlobalEnums;
import lombok.Data;

@Data
public class GlobalCustomException extends RuntimeException{
    private  String errorMessage;
    private  String errorCode;
    public GlobalCustomException(String message) {
        super(message);
    }

    /*
     * @Description: 自定义异常无参构造
     * @Author: Director
     * @Date: 2022/8/7 15:42
     * @return:
     **/
    public GlobalCustomException(){
        super();
    }
    public GlobalCustomException(String errorMessage, String errorCode) {
        super(errorMessage);
        this.errorMessage = errorMessage;
        this.errorCode = errorCode;
    }
    public GlobalCustomException(GlobalEnums g) {
        super(g.getErrorMessage());
        this.errorMessage = g.getErrorMessage();
        this.errorCode = g.getErrorCode();
    }


    public String getErrorMessage() {
        return errorMessage;
    }

    public String getErrorCode() {
        return errorCode;
    }

}
